package com.jia.leetCode;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 1431. 拥有最多糖果的孩子  https://leetcode-cn.com/problems/kids-with-the-greatest-number-of-candies/
 */
public class Pro1431 {
    public List<Boolean> kidsWithCandies(int[] candies, int extraCandies) {
        int max = Arrays.stream(candies).max().getAsInt();
        System.out.println(max);
        List<Boolean> ans = new ArrayList<>();
        for(int c : candies) {
            ans.add(c + extraCandies >= max);
        }
        return ans;
    }

    public static void main(String[] args) {
        Pro1431 pro1431 = new Pro1431();
        int[] nums = new int[] {2, 3, 5, 1, 3};
        int k = 3;
        pro1431.kidsWithCandies(nums, k);
    }
}
